#ifndef __CCFifo_H__
#define __CCFifo_H__

#include <lampe/IAbstractStack.h>
#include <lampe/exception/OutOfBounds.h>


namespace lampe{

template <typename T>
class CFifo:public IAbstractStack<T>{
private:
	LAMPE_VECTOR_VENDOR<T> list;
public:
	CFifo(){}
	virtual ~CFifo(){
		clear();
	}

	virtual void push(T variable){
		list.push_back(variable);
	}

	virtual T pop(){
		T res=get();
		list.erase(list.begin());
		return res;
	}

	virtual bool eof(){
		return size()==0;
	}

	virtual u32 size(){
		return list.size();
	}

	virtual void clear(){
		list.clear();
	}

	virtual T get(){
		T res=get(0);
		return res;
	}

	virtual T get(u32 index){
		if (index>=size())
			GEN_OutOfBounds_ERROR("CFifo ERROR: size of stack=0");
		return list[index];
	}
};

}//namespace lampe
#endif // CFifo_H
